<include file="public/header"/>

<body>

<!--main-->
<style type="text/css">
body{ background:#f4f4f4;}
</style>
<div class="pPersonal-warp"  style="padding-bottom:0;">
  <div class="bg-green">
  </div>

  <div class="porder-tab clearfix">
    <a href="javascript:;" class="active" id="3"> <i class="icon"> <img src="__PUBLIC__/home/images/porder-i1.png" class="img-show"> <img src="__PUBLIC__/home/images/porder-i1h.png" class="img-hide"> </i>
      <p class="tit">全部</p>
    </a> <a href="javascript:;" id="1"> <i class="icon"> <img src="__PUBLIC__/home/images/porder-i2.png" class="img-show"> <img src="__PUBLIC__/home/images/porder-i2h.png" class="img-hide"> </i>
      <p class="tit">已预约</p>
    </a> <a href="javascript:;" id="0"> <i class="icon"> <img src="__PUBLIC__/home/images/porder-i3.png" class="img-show"> <img src="__PUBLIC__/home/images/porder-i3h.png" class="img-hide"> </i>
      <p class="tit">待付款</p>
    </a> <a href="javascript:;" id="2"> <i class="icon"> <img src="__PUBLIC__/home/images/porder-i4.png" class="img-show"> <img src="__PUBLIC__/home/images/porder-i4h.png" class="img-hide"> </i>
      <p class="tit">已完成</p>
    </a>
  </div>

<div id="ajax_return"></div>
<!--main End-->


  <div class="pdata-column-save">
    <a href="{:U('User/center')}" class="s-btn" style="margin-top: 10px;background: #fe7200">返回个人中心</a>
  </div>

<script>
    $(document).ready(function(){
        var id = $(".porder-tab").find(".active").attr('id');
        $.ajax({
            type : "POST",
            url:"/index.php?m=home&c=Order&a=ajax_index",//+tab,
            data:{id:id},
            success: function(data){
              console.log(data);
                $("#ajax_return").html('');
                $("#ajax_return").append(data);
            }
        });
    });

    $(function () {
        $(".porder-tab a").each(function(){
            $(this).click(function () {
                $(this).addClass('active').siblings('a').removeClass('active');
                var id = $(".porder-tab").find(".active").attr('id');
                $.ajax({
                    type : "POST",
                    url:"/index.php?m=home&c=Order&a=ajax_index",//+tab,
                    data:{id:id},
                    success: function(data){
                        $("#ajax_return").html('');
                        $("#ajax_return").append(data);
                        $(".porder-tab a").removeClass('active');
                        $("[id='" + id + "']").addClass('active');
                    }
                });
            })
        });
    })
</script>

</div>
</body>
</html>
